package com.hongye.backstage.controller;

import com.hongye.backstage.entity.HongyeHouseEntity;
import com.hongye.backstage.entity.HongyeOrderEntity;
import com.hongye.backstage.service.HongyeHouseService;
import com.hongye.backstage.service.HongyeOrderService;
import com.hongye.common.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @progam:hongye-house
 * @author:GJS
 * @Time:2022/4/20 18:38
 */
@RestController
@RequestMapping("/backstage/order")
public class HongyeOrderController {
    @Autowired
    private HongyeOrderService hongyeOrderService;

    /**
     * 订单管理
     * @return
     */
    @RequestMapping("findHongyeOrderList")
    public ResponseResult findHongyeOrderList(@RequestParam(value = "type",defaultValue = "") String type,@RequestParam(value = "phone",defaultValue = "") String phone){
        List<HongyeOrderEntity> list = hongyeOrderService.findHongyeOrderList(type,phone);
        ResponseResult<List<HongyeOrderEntity>> listResponseResult = new ResponseResult<>();
        listResponseResult.setCode(0);
        listResponseResult.setData(list);
        listResponseResult.setSuccess(true);
        return listResponseResult;
    }
}
